<template>
    <div class="line">
        <div class="btn-toggle">
            <router-link to="/home/timeline/linehome"><button @click="toggle(0)" :class="index==0?'active':''">欢迎</button></router-link>
            
            <router-link to="/home/timeline/leibie"><button @click="toggle(1)" :class="index==1?'active':''">类别</button></router-link>
        </div>
    </div>
</template>

<script>
export default {
    name:"appline",
    data(){
        return {
            index:0
        }
    },
    methods:{
        toggle(i){
            this.index = i;
        }
    }
}
</script>

<style lang="less" scoped>
.line {
    width: 100%;
    // background-color: #f0f0f0;
    padding: 0px 10px 5px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    background-color: #f0f0f0;
    .btn-toggle {
        width: 100%;
        padding-left: 10px;
        box-sizing: border-box;
        button {
            font-size: 16px;
            background-color: transparent;
            color: #808080;
            margin-right: 10px;
            &.active {
                font-size: 20px;
                color: #000;
                font-weight: bold;
            }
        }
    }
}
</style>